package com.ymatou.iapi.coupon.parameter;

import java.util.List;

import com.ymatou.iapi.coupon.parameter.CouponProducts;

public class CheckCouponsData {

    private boolean IsSuccess;

    List<CouponProducts> CouponProductsList;

    public boolean isIsSuccess() {
        return IsSuccess;
    }

    public void setIsSuccess(boolean isSuccess) {
        IsSuccess = isSuccess;
    }

    public List<CouponProducts> getCouponProductsList() {
        return CouponProductsList;
    }

    public void setCouponProductsList(List<CouponProducts> couponProductsList) {
        CouponProductsList = couponProductsList;
    }

    public List<ProductInfo> getProductsByCouponCode(String couponCode)
    {
        for (CouponProducts couponProducts : CouponProductsList) {
            if (couponProducts.getCouponInfo().getCouponCode().equals(couponCode))
            {
                return couponProducts.getProducts();
            }
        }
        return null;
    }
}
